package cn.secby.goods.domain;

import java.util.List;
import com.baomidou.mybatisplus.annotation.IdType;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.baomidou.mybatisplus.annotation.*;
import cn.secby.common.core.annotation.Excel;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import cn.secby.common.core.web.domain.BaseEntity;

/**
 * 商品管理对象 tb_spu
 * @author shenkunlin
 * @date 2025-05-06
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
@TableName(value = "tb_spu")
public class Spu extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 主键 */
    @TableId(value ="id" ,type = IdType.ASSIGN_ID )
    @JsonSerialize(using=ToStringSerializer.class)
    private Long id;

    /** 商品编码 */
    @TableField(value = "spu_code")
    private String spuCode;

    /** 分类id */
    @TableField(value = "category_id")
    @JsonSerialize(using=ToStringSerializer.class)
    private Long categoryId;

    /** 品牌id */
    @Excel(name = "品牌id")
    @TableField(value = "brand_id")
    @JsonSerialize(using=ToStringSerializer.class)
    private Long brandId;

    /** 标题 */
    @Excel(name = "标题")
    @TableField(value = "title")
    private String title;

    /** 副标题 */
    @Excel(name = "副标题")
    @TableField(value = "sub_title")
    private String subTitle;

    /** 主图 */
    @Excel(name = "主图")
    @TableField(value = "main_image")
    private String mainImage;

    /** 静态页详情地址 */
    @TableField(value = "detail_html")
    private String detailHtml;

    /** 是否是虚拟商品 */
    @TableField(value = "is_virtual")
    private Integer isVirtual;

    /** 是否已同步 */
    @TableField(value = "is_sync")
    private Integer isSync;

    /** 状态 */
    @TableField(value = "status")
    private Integer status;

    /** 来源 */
    @TableField(value = "spu_source")
    private Integer spuSource;

    /** 是否删除  1 未删除  2 已删除 */
    @TableField(value = "is_delete")
    @TableLogic(value = "1", delval = "2")
    private Integer isDelete;

    /** 规格信息 */
    @TableField(exist = false)
    private List<Sku> skuList;

}
